import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
@Entity()
export class DishEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ comment: '所属菜品类别ID' })
  categoryId: number;

  @Column({ comment: '餐厅 ID' })
  restaurantId: number;

  @Column({ length: 50, comment: '菜品名称' })
  name: string;

  @Column({ length: 255, comment: '菜品描述', nullable: true })
  description: string;

  @Column({
    type: 'decimal',
    precision: 6,
    scale: 2,
    comment: '菜品价格',
    default: 0,
  })
  price: number;

  @Column({ comment: '菜品库存', default: 100 })
  stock: number;

  @Column({ comment: '菜品图片', nullable: true })
  image: string;

  @Column({ comment: '是否售罄', default: false })
  soldOut: boolean;

  @Column({ comment: '菜品排序', default: 0 })
  sort: number;
}
